import axios from 'axios';
export function getList(flipInfo,data) {
  return new Promise((resolve, reject) => {
    callBackendMethod("ztQualityConfigInfoManager", "list", flipInfo, data, {
      success: function (result) {
        resolve(result);
      },
      error: function (request, settings, e) {
        reject(JSON.parse(request.responseText).message);
      }
    });
  });
}
export function  saveData(data){
  return new Promise((resolve, reject) => {
    callBackendMethod("ztQualityConfigInfoManager", "save", data, {
      success: function (result) {
        resolve(result);
      },
      error: function (request, settings, e) {
        reject(JSON.parse(request.responseText).message);
      }
    });
  });
}
export function  deleteDataByIds(ids){
  return new Promise((resolve, reject) => {
    callBackendMethod("ztQualityConfigInfoManager", "deleteByIds", ids, {
      success: function (result) {
        resolve(result);
      },
      error: function (request, settings, e) {
        reject(JSON.parse(request.responseText).message);
      }
    });
  });
}
export function checkFile(file) {
  const formData = new FormData();
  formData.append('file', file);
  return axios.post('/seeyon/ztQualityConfig.do', formData, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

